package com.yc.cloud.common.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 启动时加载的配置
 *
 * @author 杨智杰
 * @date 2021/8/12 15:03
 */
@Slf4j
@Component
public class BaseRunConfig implements ApplicationRunner {

    @Resource
    private ServerConfig serverConfig;

    @Value("${knife4j.production:false}")
    private Boolean production;

    @Override
    public void run(ApplicationArguments args) {
        log.info("swagger地址:" + (production ? "swagger已禁用!" : serverConfig.getSwaggerUrl()));
        log.info("-------------------------启动完毕,欢迎使用-------------------------");
    }

}
